Integrand size = 21, antiderivative size = 78 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-a^2 x+\frac {b^2 x}{2}-\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos (c+d x)}{d}-\frac {a^2 \cot (c+d x)}{d}+\frac {b^2 \cos (c+d x) \sin (c+d x)}{2 d} \]
-a^2*x+1/2*b^2*x-2*a*b*arctanh(cos(d*x+c))/d+2*a*b*cos(d*x+c)/d-a^2*cot(d* x+c)/d+1/2*b^2*cos(d*x+c)*sin(d*x+c)/d
Time = 0.22 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.49 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {-4 a^2 c+2 b^2 c-4 a^2 d x+2 b^2 d x+8 a b \cos (c+d x)-2 a^2 \cot \left (\frac {1}{2} (c+d x)\right )-8 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+8 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^2 \sin (2 (c+d x))+2 a^2 \tan \left (\frac {1}{2} (c+d x)\right )}{4 d} \]
(-4*a^2*c + 2*b^2*c - 4*a^2*d*x + 2*b^2*d*x + 8*a*b*Cos[c + d*x] - 2*a^2*C ot[(c + d*x)/2] - 8*a*b*Log[Cos[(c + d*x)/2]] + 8*a*b*Log[Sin[(c + d*x)/2] ] + b^2*Sin[2*(c + d*x)] + 2*a^2*Tan[(c + d*x)/2])/(4*d)
Time = 0.29 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3201, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \sin (c+d x))^2}{\tan (c+d x)^2}dx\) |
\(\Big \downarrow \) 3201 |
\(\displaystyle \int \left (a^2 \cot ^2(c+d x)+2 a b \cos (c+d x) \cot (c+d x)+b^2 \cos ^2(c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {a^2 \cot (c+d x)}{d}+a^2 (-x)-\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos (c+d x)}{d}+\frac {b^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {b^2 x}{2}\) |
-(a^2*x) + (b^2*x)/2 - (2*a*b*ArcTanh[Cos[c + d*x]])/d + (2*a*b*Cos[c + d* x])/d - (a^2*Cot[c + d*x])/d + (b^2*Cos[c + d*x]*Sin[c + d*x])/(2*d)
3.11.63.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((g_.)*tan[(e_.) + (f_.)*( x_)])^(p_.), x_Symbol] :> Int[ExpandIntegrand[(g*Tan[e + f*x])^p, (a + b*Si n[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2, 0] && IGtQ[m, 0]
Time = 0.35 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.01
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+2 a b \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(79\) |
default | \(\frac {a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+2 a b \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(79\) |
parallelrisch | \(\frac {2 \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2}-4 a^{2} d x +2 b^{2} d x +8 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -4 a^{2} \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+8 a b \cos \left (d x +c \right )+b^{2} \sin \left (2 d x +2 c \right )+8 a b}{4 d}\) | \(99\) |
risch | \(-a^{2} x +\frac {b^{2} x}{2}-\frac {i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {i b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {2 i a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(140\) |
norman | \(\frac {\left (-a^{2}+\frac {b^{2}}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-a^{2}+\frac {b^{2}}{2}\right ) x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 a^{2}+b^{2}\right ) x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a^{2}}{2 d}+\frac {a^{2} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {\left (a^{2}-2 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {\left (a^{2}-2 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {4 a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(228\) |
1/d*(a^2*(-cot(d*x+c)-d*x-c)+2*a*b*(cos(d*x+c)+ln(csc(d*x+c)-cot(d*x+c)))+ b^2*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c))
Time = 0.30 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.51 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {b^{2} \cos \left (d x + c\right )^{3} + 2 \, a b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 2 \, a b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right ) + {\left ({\left (2 \, a^{2} - b^{2}\right )} d x - 4 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, d \sin \left (d x + c\right )} \]
-1/2*(b^2*cos(d*x + c)^3 + 2*a*b*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 2*a*b*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + (2*a^2 - b^2)*cos(d*x + c) + ((2*a^2 - b^2)*d*x - 4*a*b*cos(d*x + c))*sin(d*x + c))/(d*sin(d*x + c))
\[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx \]
Time = 0.27 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.01 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {4 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} - {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} b^{2} - 4 \, a b {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \]
-1/4*(4*(d*x + c + 1/tan(d*x + c))*a^2 - (2*d*x + 2*c + sin(2*d*x + 2*c))* b^2 - 4*a*b*(2*cos(d*x + c) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1 )))/d
Time = 0.40 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.90 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {4 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - {\left (2 \, a^{2} - b^{2}\right )} {\left (d x + c\right )} - \frac {4 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
1/2*(4*a*b*log(abs(tan(1/2*d*x + 1/2*c))) + a^2*tan(1/2*d*x + 1/2*c) - (2* a^2 - b^2)*(d*x + c) - (4*a*b*tan(1/2*d*x + 1/2*c) + a^2)/tan(1/2*d*x + 1/ 2*c) - 2*(b^2*tan(1/2*d*x + 1/2*c)^3 - 4*a*b*tan(1/2*d*x + 1/2*c)^2 - b^2* tan(1/2*d*x + 1/2*c) - 4*a*b)/(tan(1/2*d*x + 1/2*c)^2 + 1)^2)/d
Time = 10.18 (sec) , antiderivative size = 277, normalized size of antiderivative = 3.55 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {b^2\,\mathrm {atan}\left (\frac {-2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}\right )-2\,a^2\,\mathrm {atan}\left (\frac {-2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}\right )+2\,a\,b\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a^2\,\cos \left (c+d\,x\right )-\frac {b^2\,\cos \left (c+d\,x\right )}{8}+\frac {b^2\,\cos \left (3\,c+3\,d\,x\right )}{8}-a\,b\,\sin \left (2\,c+2\,d\,x\right )}{d\,\sin \left (c+d\,x\right )} \]
(b^2*atan((b^2*cos(c/2 + (d*x)/2) - 2*a^2*cos(c/2 + (d*x)/2) + 4*a*b*sin(c /2 + (d*x)/2))/(2*a^2*sin(c/2 + (d*x)/2) - b^2*sin(c/2 + (d*x)/2) + 4*a*b* cos(c/2 + (d*x)/2))) - 2*a^2*atan((b^2*cos(c/2 + (d*x)/2) - 2*a^2*cos(c/2 + (d*x)/2) + 4*a*b*sin(c/2 + (d*x)/2))/(2*a^2*sin(c/2 + (d*x)/2) - b^2*sin (c/2 + (d*x)/2) + 4*a*b*cos(c/2 + (d*x)/2))) + 2*a*b*log(sin(c/2 + (d*x)/2 )/cos(c/2 + (d*x)/2)))/d - (a^2*cos(c + d*x) - (b^2*cos(c + d*x))/8 + (b^2 *cos(3*c + 3*d*x))/8 - a*b*sin(2*c + 2*d*x))/(d*sin(c + d*x))